<template>
  <div class="goodssections-container">
    <van-goods-action>
      <van-goods-action-icon
      :icon="isChecked?'star':'star-o'"
      :text='isChecked?"已收藏":"未收藏"'
      :color='isChecked?"darkred":"#666"'
      @click="isChecked=!isChecked"
      />
      <van-goods-action-icon icon="cart-o" text="购物车" :badge="goodsCount"/>
      <van-goods-action-button type="warning" text="加入购物车" @click="toGoCart"/>
      <van-goods-action-button type="danger" text="立即购买" @click="immidiate"/>
    </van-goods-action>
  </div>
</template>

<script>
export default {
  props: ['goodsCount'],
  data() {
    return {
      // 购物车判断
      isChecked: false
    }
  },
  methods: {
    immidiate() {
      // console.log('功能未开放')
      this.$toast('功能未开放')
    },
    // 子传父（ProductDetail）看sku组件是否展开
    toGoCart() {
      this.$emit('toGoCart')
    }
  }
}
</script>

<style lang="less" scoped>
.van-goods-action{
  z-index: 99999;
}

</style>
